﻿using System.Windows;
using BHS.TFSChangsetAnalyser.Export;
using BHS.TFSChangsetAnalyser.Import;
using BHS.TFSChangsetAnalyser.Model;
using BHS.TFSChangsetAnalyser.View;
using BHS.TFSChangsetAnalyser.ViewModel;
using Microsoft.Practices.Unity;

namespace BHS.TFSChangsetAnalyser
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private UnityContainer _container;

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            _container = new UnityContainer();
            _container.RegisterType<IMainWindowViewModel, MainWindowViewModel>();
            _container.RegisterType<IChangesetInfoExporter, XmlChangesetInfoExporter>();
            _container.RegisterType<IExportFilenameProvider, SaveDialog>();
            _container.RegisterType<IDefaultValuesProvider, FileBasedDefaultValuesProvider>();
            _container.RegisterType<IChangesetInformationProvider, TfsServerChangesetProvider>();
            _container.RegisterType<IErrorPresenter, MessageBoxErrorPresenter>();

            MainWindow window = _container.Resolve<MainWindow>();
            window.Show();
        }

    }
}
